package springframework.beans.factory.support;

import springframework.beans.factory.config.SingletonBeanRegister;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class DefaultSingletonBeanRegister implements SingletonBeanRegister {

   private Map<String, Object> singletonObjects = new ConcurrentHashMap<String, Object>();


    public Object getSingleton(String beanName) {
        return singletonObjects.get(beanName);
    }

    protected void addSingleton(String beanName, Object singletonObject){
        singletonObjects.put(beanName, singletonObject);
    }
}
